package com.edu.cmsservice.controller;

import com.edu.cmsservice.entity.CrmBanner;
import com.edu.cmsservice.service.CrmBannerService;
import com.edu.common.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 前台
 */
@RestController
@RequestMapping("/educms/bannerFront")
@Api(description = "网站首页Banner列表")
@CrossOrigin
public class BannerApiController {
    @Autowired
    private CrmBannerService crmBannerService;

    /**
     * 获取banner首页
     * @return
     */
    @ApiOperation("获取首页banner")
    @GetMapping("/getAllBanner")
     public R index(){
       List<CrmBanner> list = crmBannerService.selectIndexList();
       return R.ok().data("bannerList",list);
    }

}
